﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyHealthOnline.Dal.Generated.EntityClasses;
using MyHealthOnline.Dal.Generated.CollectionClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
using MyHealthOnline.Dal.Generated.HelperClasses;

namespace MyHealthOnline.Business
{
    public static class AppProposalBusiness
    {
        public static void AddAppointment(int consultId, string nextDateMessage, string nextDate, string status)
        {
            AppProposalEntity appProposal = new AppProposalEntity();
            appProposal.ConsultId = consultId;
            appProposal.NextWebConsultDate = Convert.ToDateTime( nextDate);
            appProposal.Description = nextDateMessage;

            appProposal.Consult.Status = status;
            appProposal.Consult.Save();
            appProposal.Save();
        }

        public static AppProposalCollection GetAppointmentsForConsult(int ConsultId)
        {
            PredicateExpression filter = new PredicateExpression(AppProposalFields.ConsultId==ConsultId);
            AppProposalCollection appProposalColl = new AppProposalCollection();
            appProposalColl.GetMulti(filter);
            return appProposalColl;
        }
    }
}
